<template>
  <div class="bottom-bar">
    <div class="service">
      <img src="~assets/img/detail/service.png" alt="" />
      <span>客服</span>
    </div>
    <div class="shop">
      <img src="~assets/img/detail/shop.png" alt="" />
      <span>店铺</span>
    </div>
    <div class="collection">
      <img src="~assets/img/detail/star1.png" alt="" />
      <span>收藏</span>
    </div>
    <div class="add-cart" @click="addTOCart">加入购物车</div>
    <div class="buy" @click="buy">购买</div>
  </div>
</template>

<script>
export default {
  name: "detailBottomBar",
  methods: {
    addTOCart() {
      this.$emit("addToCart");
    },
    buy() {
      this.$emit("buy");
    },
  },
};
</script>

<style scoped>
.bottom-bar {
  position: fixed;
  height: 48px;
  background-color: #fafafa;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  text-align: center;
  color: #5e5d21;
}
.bottom-bar div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.service {
  flex: 1;
}
.service img {
  width: 20px;
}
.shop {
  flex: 1;
}
.shop img {
  width: 18px;
}
.shop span {
  padding-top: 2px;
}
.collection {
  flex: 1;
}

.add-cart {
  flex: 2;
  background-color: #fcdc08;
  height: 100%;
  font-size: 14px;
  color: #333333;
  font-weight: 500;
}
.buy {
  flex: 2;
  background-color: #fc7398;
  height: 100%;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}
</style>
